import { Server } from "socket.io";

interface ServerToClientEvents {
  chat_msg: (msg: string) => void;
  server: () => void;
}

interface ClientToServerEvents {
  chat_msg: (msg: string) => void;
  client: () => void;
}

interface InterServerEvents {}
// 注意：在服务端这里的顺利是客户端后服务端的事件类型，而客户端的socket设置是相反的。可以查阅 https://socket.io/docs/v4/typescript/#types-for-the-server
export type ServerType = Server<
  ClientToServerEvents,
  ServerToClientEvents,
  InterServerEvents
>;
